﻿namespace NMortgage.UI.ViewModels
{
    using System.Collections.ObjectModel;

    using Caliburn.Micro;

    using NMortgage.UI.Events;
    using NMortgage.UI.Model;

    public sealed class InterestParameterListViewModel : ABaseItemListViewModel<InterestParameterCollection, IInterestRate>
    {

        #region Constructors

        public InterestParameterListViewModel(IEventAggregator eventAggregator)
            : base(eventAggregator)
        {
            ItemCollection = new InterestParameterCollection();
        }

        #endregion Constructors

        #region Properties
        
        public override string Title
        {
            get
            {
                return Properties.Resources.InterestRate;
            }
        }

        #endregion Properties

        #region Methods

        public override void Add()
        {
            ItemDialog = new InterestParameterViewModel(EventAggregator);
        }

        public override void Edit(IInterestRate parameter)
        {
            ItemDialog = new InterestParameterViewModel(EventAggregator, parameter);
        }

        #endregion Methods
    }
}